home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / batch / tsbat36.zip / EXE2ZIP.BAT < prev    next >
DOS Batch File  |  1992-03-21  |  2KB  |  86 lines

  1. @echo off
  2.  
  3. echo.
  4. echo ┌─────────────────────────────────────────────────────────────────────┐
  5. echo │ Convert + datestamp self-extracting file to .zip file, with comment │
  6. echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, Sat 21-Mar-1992             │
  7. echo └─────────────────────────────────────────────────────────────────────┘
  8. echo.
  9.  
  10. rem Is help needed
  11. if "%1"=="" goto _help
  12.  
  13. rem Check that no wildcards were used
  14. for %%f in (%1) do if "%%f"=="%1" goto _ok
  15. echo.
  16. echo Wildcards / extensions not allowed in %1
  17. goto _out
  18.  
  19. rem Check for the necessary programs and status
  20. rem You'' have to customize these
  21. :_ok
  22. if not exist %1.exe goto _notfound
  23. if not exist e:\arczip\comment.txt goto _nocomment
  24. if not exist c:\tools\scan.exe goto _noscan
  25. if not exist c:\tools\pkzip.exe goto _nopkzip
  26. if not exist r:\nul goto _no_r
  27. if exist r:\tmp$$$\*.* goto _notempty
  28.  
  29. rem Convert (I have r: as ramdisk, customize as applicable)
  30. r:
  31. if not exist r:\tmp$$$\nul mkdir r:\tmp$$$
  32. cd \tmp$$$
  33. r:\%1
  34. if not exist r:\tmp$$$\*.* goto _notsfx
  35. c:\tools\scan /m /nomem r:\tmp$$$
  36. if errorlevel==1 goto _virus
  37. pkzip -mu -o -z r:\%1 *.* < e:\arczip\comment.txt
  38. cd \
  39. rmdir r:\tmp$$$
  40. goto _out
  41.  
  42. :_notfound
  43. echo File %1.exe not found
  44. goto _out
  45.  
  46. :_nocomment
  47. echo File e:\arczip\comment.txt not found
  48. echo You'll have to contomize the batch or omit this feature
  49. goto _out
  50.  
  51. :_noscan
  52. echo File c:\tools\scan.exe not found
  53. echo You'll have to adjust for your own configuration
  54. goto _out
  55.  
  56. :_nopkzip
  57. echo File c:\tools\pkzip.exe not found
  58. echo You'll have to adjust for your own configuration
  59. goto _out
  60.  
  61. :_no_r
  62. echo No R: drive
  63. echo Customize the batch or create one with SUBST
  64. goto _out
  65.  
  66. :_notempty
  67. echo Directory r:\tmp$$$ not empty
  68. goto _out
  69.  
  70. :_notsfx
  71. echo File %1.exe is not self-extracting
  72. cd \
  73. rmdir r:\tmp$$$
  74. goto _out
  75.  
  76. :_virus
  77. echo Virus warning
  78. cd \
  79. goto _out
  80.  
  81. :_help
  82. echo Usage: EXE2ZIP FileName  (No path, no extension)
  83.  
  84. :_out
  85. echo on
  86.